<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: QUANYUNA
  Date: 2021/5/11
  Time: 10:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //获取项目的根路径
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>遗失物品</title>
    <style type="text/css">
        * {
            margin: auto;
            padding: 0px;
        }

        #lost_div {

            width: 800px;
            height: 750px;
            margin: auto;
            padding: 0px;
            /*border: blue 2px solid;*/
        }


        #table_select{
            position: relative;
            left: -10px;
            top: 70px;
        }

        #table_txt {
            background: white;
            font-size: 25px;
            margin-top: 80px;
            width: 600px;
        }

        #td_two{
            background: red;
            position: relative;
            left: 150px;
        }

        h2{
            position: relative;
            top: 50px;
            font-style:italic;
            font-size: 50px;
            text-align: center;
        }

        #tr_last{
            font-size: 20px;
            background: #00FFFF;
            color: #FF00FF;
        }




        #insert_table tr td{
            position: relative;
            left:40px;
            font-size: 30px;
            padding-top: 30px;
        }

        input[name='submit_td_two'],input[name='button_two_td'],input[name='button_exit']{
            font-size: 20px;
        }

        input[name='button_two_td']{
            position: relative;
            left: -350px;
        }

        input[name='button_exit']{
            position: relative;
            top: -60px;
            left: 400px;
        }


        #update_div{
            text-align: center;
            display: none;
            position: relative;
            top: -650px;
            background: white;
            width: 800px;
            height: 600px;
            margin: auto;
            padding: 0px;
            /*border: blue 2px solid;*/
        }

        #update_table{
            color: red;
            position: relative;
            left: -10px;
            top: 50px;
        }

        #phone_input{
            position: relative;
            left: 80px;
            top: 0px;
        }
        h1 {
            position: relative;
            top: 40px;
            font-style: italic;
            text-align: center;
        }

        #update_table td{
            padding: 20px;
            /*text-align: center;*/
        }

        #phone_input{
            position: relative;
            left: 0px;
            top: 0px;
        }

        #empty{
            position: relative;
            left: 50px;
        }

        #exit{
            position: relative;
            left: 100px;
            top: 0px;
        }

        #td_sel{
            color: red;
            position: relative;
            top: -120px;
            left: -450px;
        }

    </style>
    <link rel="stylesheet" href="<%=basePath%>/layui-v2.6.6/css/layui.css">
    <link rel="stylesheet" href="<%=basePath%>/gq/jsp/css/donateBook.css">
<%--    <link rel="stylesheet" href="<%=basePath%>/gq/jsp/css/lostThings.css">--%>
</head>
<body>
<div id="lost_div">
    <h2>失物招领</h2>
    <table id="table_select">
        <tr>
            <form action="<%=basePath%>/BookServlet?tp=sel" method="post">
                <td><input type="text"name="select" placeholder="全部"></td>
                <td><input type="submit" value="查询" ></td>
            </form>
            <td id="td_two"><a href="<%=basePath%>/book/jsp/lostInsert.jsp">添加</a></td>

            <form action="<%=basePath%>/BookServlet?tp=claim_select" method="post">
               <td id="td_sel"><input type="submit"value="查询全部领取信息"></td>
            </form>
        </tr>
    </table>
    <table id="table_txt" border="2px">
        <tr>
            <td>编码</td>
            <td>遗失的物品名</td>
            <td>时间</td>
            <td>状态</td>
            <td>执行</td>
        </tr>
        <c:forEach items="${page.list}" var="list">
            <tr>
                <td>${list.getId()}</td>
                <td>${list.getGoodsName()}</td>
                <td>${list.getTime()}</td>
                <td>${list.getState()}</td>
                <td class="update">
                    <input type="button"value="修改" >
                </td>
            </tr>
        </c:forEach>
        <tr id="tr_last">
            <td colspan="5" align="center">
                <a href="<%=basePath%>BookServlet?currentPage=1&tp=sel">首页</a>
                <a href="<%=basePath%>BookServlet?currentPage=${requestScope.page.currentPage-1}&tp=sel">上一页</a>
                <a href="<%=basePath%>BookServlet?currentPage=${requestScope.page.currentPage+1}&tp=sel">下一页</a>
                <a href="<%=basePath%>BookServlet?currentPage=${requestScope.page.totalPage}&tp=sel">末页</a>
            </td>
        </tr>
    </table>
</div>
<div id="update_div">
        <table id="update_table">
            <form action="<%=basePath%>BookServlet?tp=insert_claim" method="post">
                    <h1>失物认领信息</h1>
                <tr><td><input type="hidden" name="id" id="idd" ></td></tr>

<%--                <tr><td><input type="hidden" name="goodsName" id="goods_Name"></td></tr>--%>

                <tr><td>
                    <span>失主姓名:</span>
                    <input type="text" name="name_claim" required>
                </td></tr>

                <tr><td>
                    <span>身份证号:</span>
                    <input type="text" name="card_claim"required>
                </td></tr>

                <tr><td>
                    <span> 认领时间:</span>
                    <input type="date"name="date_claim">
                </td></tr>

                <tr><td id="phone_input">
                    <span> 手机号码:</span>
                    <input type="text" name="phone_claim">
                </td></tr>

                <tr><td><input type="hidden" name="state" value="已领走"></td></tr>

                <tr>
                    <td>
                        <input type="submit"name="button_update" value="确定">
                        <input type="button"name="button_empty" value="清空" id="empty">
                        <input type="button"name="button_exit" value="退出" id="exit">
                </td>
                </tr>
            </form>
        </table>

</div>
<script src="<%=basePath%>/layui-v2.6.6/layui.js"></script>
<script src="<%=basePath%>/jquery-1.12.4.js"></script>
<%--<script src="<%=basePath%>/gq/jsp/javaScript/donateBook.js"></script>--%>
<script type="text/javascript">
    $(document).ready(function () {

        //点击进行修改功能的js
        $(".update").click(function () {
            let list = $(this).parent().children();
            $("#idd").val(list.text()[0]);
            $("#update_div").show();
        });
        //点击进行修改页面的隐藏
        $("#exit").click(function () {
            $("#update_div").hide();
        });
    })
</script>
</body>
</html>
